package com.hoperun.service;

import java.util.List;

import com.hoperun.bean.AdminPermissions;
import com.hoperun.bean.AdminRoles;
import com.hoperun.framework.ibatis.page.BootGrid;
import com.hoperun.framework.ibatis.page.BootGridPage;
import com.hoperun.framework.query.Criteria;

public interface IAdminRolesSV
{
    /**
	 * 根据主键查询
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public AdminRoles queryById(Long id)throws Exception;
	
	/**
	 * 添加
	 * @param adminRoles
	 * @return
	 * @throws Exception
	 */
	public AdminRoles save(AdminRoles adminRoles)throws Exception;
	
	/**
	 * 更新
	 * @param adminRoles
	 * @throws Exception
	 */
	public void update(AdminRoles adminRoles)throws Exception;
	
	/**
	 * 物理删除
	 * @param id
	 * @throws Exception
	 */
	public void delete(Long id)throws Exception;

	/**
	 * 新增或删除
	 * @param adminRoles
	 * @throws Exception
	 */
	public void saveOrUpdate(AdminRoles adminRoles)throws Exception;

	/**
	 * 新增或删除
	 * @param list
	 * @throws Exception
	 */
	public void saveOrUpdate(List<AdminRoles> list)throws Exception;

	/**
	 * 按条件查询记录
	 * @param criteria
	 * @throws Exception
	 */
	public List<AdminRoles> queryByCondition(Criteria criteria)throws Exception;
	
	/**
	 * 按条件查询记录条数
	 * @param criteria
	 * @throws Exception
	 */
	public int queryCountByCondition(Criteria criteria)throws Exception;
	/**
	 * 根据当前登录用户编号查询当前用户所有权限
	 * @param managerId
	 * @return
	 * @throws Exception
	 */
	public List<AdminPermissions> queryPermissByMgrId()throws Exception;
	
	/**
	 * 根据角色编号查询对应的角色的所有权限
	 * @param roleId
	 * @return
	 * @throws Exception
	 */
	public List<AdminPermissions> queryPermissByRoleId(Long roleId)throws Exception;
	
	/**
	 * 分配权限保存
	 * @param pers
	 * @param ids
	 * @throws Exception
	 */
	public void allocSave(String permission ,Long[] ids)throws Exception;
	/**
	 *  分页查询
	 * @param criteria
	 * @return
	 * @throws Exception
	 */
	public BootGridPage<AdminRoles> queryPage(Criteria criteria,
			BootGrid<AdminRoles> grid) throws Exception ;
}
